package com.bihu.bihudemo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.bihu.bihudemo.myenum.LikedStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * (CommentLike)表实体类
 *
 * @author makejava
 * @since 2020-07-16 16:09:13
 */
@SuppressWarnings("serial")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CommentLike extends Model<CommentLike> {


    @TableId(type = IdType.AUTO)
    private Integer id;
    //被点赞的评论ID
    private Integer cid;
    //点赞的用户ID
    private Integer uid;
    //点赞状态，0没点赞 1 点了赞
    private Integer status= LikedStatusEnum.UNLIKE.getCode();;

    /**
     *
     * @param likedCommentId 被点赞的评论
     * @param likedUserId 点赞的人
     * @param value 点赞状态 0 没有点，1 点了
     */

    public CommentLike(Integer likedCommentId, Integer likedUserId, Integer value) {
        this.cid=likedCommentId;
        this.uid=likedUserId;
        this.status=value;
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getCid() {
        return cid;
    }

    public void setCid(Integer cid) {
        this.cid = cid;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     * 获取主键值
     *
     * @return 主键值
     */
    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}